Glob to pattern function in Lua